<template>
  <div class="goods-item">
    <img :src="'http://localhost:8088/' + item.product_img" alt="" />
    <div class="goods-title">{{ item.product_name }}</div>
    <div class="goods-price">
      ￥{{ item.product_price }}
      <!-- 加购按钮 -->
      <!-- <van-button round type="danger" size="small">加入购物车</van-button> -->
    </div>
  </div>
</template>

<script setup>
import { reactive } from 'vue'

const imgs = reactive(['img1', 'img2', 'img3', 'img4'])

// 获取props的数据
const props = defineProps({
  item: {
    type: Object,
    default: () => ({})
  }
})
const { item } = props
// console.log(item)
</script>

<style lang="less" scoped>
.goods-item {
  background-color: #fff;
  width: 45%;
  border-radius: 15px;
  overflow: hidden;
  img {
    width: 100%;
  }
  .goods-title {
    box-sizing: border-box;
    padding-left: 10px;
    // font-size: 1.1rem;
  }
  .goods-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    font-size: 1rem;
    color: #ff3800;
  }
}
</style>
